package com.nervenets.shopping.controller.setting.params;

import com.nervenets.general.exception.LogicException;
import com.nervenets.general.web.params.FormParams;
import com.nervenets.shopping.hibernate.domain.common.GlobalRule;
import com.nervenets.shopping.hibernate.domain.common.GlobalRuleSetting;
import com.nervenets.shopping.service.GlobalRuleService;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@EqualsAndHashCode(callSuper = true)
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class GlobalRuleFormParams extends FormParams<GlobalRule, GlobalRuleService> {
    @ApiModelProperty(value = "名称", required = true)
    @NotBlank
    private String name;
    @ApiModelProperty(value = "是否启用")
    private boolean enable;
    @ApiModelProperty(value = "设置明细", required = true)
    @NotNull
    @Valid
    private GlobalRuleSetting setting = new GlobalRuleSetting();

}
